<template>
<div class="sel-langs">
  <el-select v-model="lang" placeholder="请选择" @change = 'switchLang'>
    <el-option v-for="item in langArr" :key="item.value" :label="item.label"  :value="item.value">
    </el-option>
  </el-select>
</div>
</template>

<script>
    export default {
      name: "langsSet",
      data() {
        return {
          lang: 'en',
          langArr: [{
            value: 'cn',
            label: '中文'
          }, {
            value: 'en',
            label: 'English'
          }, {
            value: 'jn',
            label: '日本語'
          }],
          brands: [this.$t('brands.nike'), this.$t('brands.adi'), this.$t('brands.nb'), this.$t('brands.ln')],
        }
      },
      methods: {
        switchLang()  {
          this.$i18n.locale = this.lang;
          var a = JSON.stringify({'lang':JSON.stringify(this.lang)});
          sessionStorage.setItem({'langs':a});
        },
        handleReset2() {
          this.$refs.ruleForm2.resetFields();
        },
      },
    }
</script>

<style scoped>
  .sel-langs{ width: 120px;}
  .sel-langs .el-input--suffix .el-input__inner{border: none !important;}
</style>
